package cn.tedu.tmall.basic.startup;

import cn.tedu.tmall.basic.service.IDistrictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class DistrictRunner implements ApplicationRunner {
    @Autowired
    private IDistrictService service;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        System.out.println("开始向缓存中存入district数据");
        service.rebuildCache();
        System.out.println("district数据存储完成");
    }
}
